package com.example.updownload_file.service;

import com.example.updownload_file.entity.FileInfo;
import com.example.updownload_file.mapper.FileMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by tanglp on 2023/5/27 20:08
 */
@Service
public class UploadService {

    @Autowired
    private FileMapper fileMapper;

    public boolean save(FileInfo fileInfo) {
        int insert = fileMapper.insert(fileInfo);
        if (insert == 1) {
            return true;
        }
        return false;
    }

    public FileInfo selectById(int id) {
        return fileMapper.selectById(id);
    }

    public List<FileInfo> findAll() {
        return fileMapper.selectAll();
    }

}
